package com.yyy.spring6.di2;

import java.util.List;

/**
 * @Project ：learn_spring
 * @File ：Department.java
 * @IDE ：IntelliJ IDEA
 * @Author ：自由如风间
 * @Date ：2025/3/29 17:18
 * @Description ：For study.
 */

// 部门类
public class Department {

    // 牛马们
    private List<Employee> slaves;

    private String name;

    public List<Employee> getSlaves() {
        return slaves;
    }

    public void setSlaves(List<Employee> slaves) {
        this.slaves = slaves;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void info() {
        System.out.println("部门：" + name);
        System.out.println("走过路过别错过，出售最新鲜、听话的牛马：");
        int c = 1;
        for (Employee slave : slaves) {
            System.out.println(c++ + "号: " + slave.getName());
        }
    }
}
